package com.dgut.service.background.service;

import com.dgut.service.background.dao.InspectorDao;
import com.dgut.service.background.entity.Inspector;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class InspectorService {
    @Autowired
    private InspectorDao inspectorDao;

    public Inspector findByOpenId(String openId){
        Inspector inspector = inspectorDao.findInspectorByOpenid(openId);
        //判断检察员账号是否已注销
        if (inspector == null){
            inspector.setInspectorId(0);
            inspector.setPassword("暂无数据");
            inspector.setSex("暂无数据");
            inspector.setPhone("暂无数据");
            inspector.setName("暂无数据");
            inspector.setName("暂无数据");
        }
        return inspector;
    }
}
